package com.group3.pojo.result;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.group3.controller.Validated.Add;
import com.group3.domain.Lesson;
import com.group3.domain.StudentInfoByLesson;
import com.group3.pojo.DropTeacherName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Null;
import java.util.Date;
import java.util.List;

/**
 * @ClassName Lesson
 * @Author jt-sinlio
 * @Time 2021/6/7 15:15
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("查看课程安排列表")
public class LessonResult {
//    @ApiModelProperty(value = "上课时间（某一天）")
//    private Date date;
//
//    @ApiModelProperty(value = "课程id")
//    private Integer lessonId;
//
//    @ApiModelProperty(value = "课程名称")
//    private String lessonName;
//
//    @ApiModelProperty(value = "实训教师")
//    private List<DropTeacherName> teacherSNames;
//
//    @ApiModelProperty(value = "责任教师")
//    private String teacherZName;
//
//    @ApiModelProperty(value = "应签到时间")
//    private Date startTime;
//
//    @ApiModelProperty(value = "应签退时间")
//    private Date endTime;
//
//    @ApiModelProperty(value = "教室名")
//    private String classRoom;
//
//    @ApiModelProperty(value = "备注")
//    private String remark;


    @ApiModelProperty(value = "排课id")
    @NotBlank(message = "排课id不能为空", groups = Add.class)
    private Integer lessonId;

    @ApiModelProperty(value = "课程名")
    @NotBlank(message = "课程名不能为空", groups = Add.class)
    private String lessonName;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "上课时间（某一天）")
    private Date date;

    @JsonFormat(pattern = "HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "应签到时间")
    private Date startTime;

    @JsonFormat(pattern = "HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "应签退时间")
    private Date endTime;

    @ApiModelProperty(value = "教室名")
    @NotBlank(message = "教室名不能为空", groups = Add.class)
    private String classRoom;

    @ApiModelProperty(value = "备注")
    private String remark;

    @NotBlank(message = "责任教师不能为空", groups = Add.class)
    @ApiModelProperty(value = "责任教师id")
    private String teacherId;

    @ApiModelProperty(value = "状态")
    @Null(message = "不能加状态！", groups = Add.class)
    private Integer state;

    @ApiModelProperty(value = "状态")
    @Null(message = "不能加状态！", groups = Add.class)
    private String stateStr;

    public String getStateStr() {
        switch (state) {
//            0-使用；1-已有记录，逻辑删除；-1只是课程名
            case 0:
                return "使用";
            case 1:
                return "已有记录，逻辑删除";
            case -1:
                return "只是课程名";
        }
        return "?";
    }

    @ApiModelProperty(value = "实训教师")
    private List<String> teacherSNames;

    @ApiModelProperty(value = "责任教师")
    private String teacherZName;
}
